<?php

namespace app\api\model\shop;

use think\Model;
use traits\model\SoftDelete;

class ShopModel extends Model
{
    use SoftDelete;


    // 表名
    protected $name = 'shop';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'integer';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    protected $deleteTime = 'deletetime';

    // 追加属性
    protected $append = [

    ];


    public function getAvatarAttr($value)
    {
        return Https($value);
    }


    /**
     * Notes: 店铺列表
     * User: AerYYY
     * Date: 6/28/25
     * @return bool|\PDOStatement|string|\think\Collection
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    public function list()
    {
        return $this->field('id,name,avatar,address,createtime')->select();
    }


}